<?php

declare(strict_types=1);
/**
 * This file is part of Hyperf.
 *
 * @link     https://www.hyperf.io
 * @document https://doc.hyperf.io
 * @contact  group@hyperf.io
 * @license  https://github.com/hyperf-cloud/hyperf/blob/master/LICENSE
 */

namespace App\Controller;

use Hyperf\HttpServer\Annotation\AutoController;
use Hyperf\Redis\Redis;
use Hyperf\Utils\ApplicationContext;

/**
 * @AutoController()
 * Class IndexController
 * @package App\Controller
 */
class IndexController extends AbstractController
{
    /**
     * @return array
     */
    public function index()
    {
        $user = $this->request->input('user', 'Hyperf');
        $method = $this->request->getMethod();

//        $container = ApplicationContext::getContainer();
//
//        $redis = $container->get(Redis::class);
//        $result = $redis->keys('*');

        return [
            'method' => $method,
            'message' => "Hello {$user}.",
//            'redis' => $result
        ];
    }
}
